     {  Petrova Tatjana
        2012 / 11 / 12
        This program can write you the destination between an area and a  line. }
program DestinationBetweenAreaAndLine;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  x1,y1,z1,a,b,c,d,x2,y2,z2,x3,y3,z3, x0,y0,z4,x4,y4,z0,d1,d2: real;

begin
  readln(x1,y1,z1);
  readln(x2,y2,z2);
  readln(x3,y3,z3);
  readln(x0,y0,z0);
  readln(x4,y4,z4);
  a:=(y1-y2)*(z2-z3)-(y2-y3)*(z1-z2);
  b:=-((x1-x2)*(z2-z3)-(x2-x3)*(z1-z2));
  c:= (x1-x2)*(y2-y3)-(x2-x3)*(y1-y2);
  d:=-(a*x1+b*y1+c*z1);
  d1:=(a*x0+b*x0+c*z0+d)/sqrt(a*a+b*b+c*c);
  d2:=(a*x4+b*x4+c*z4+d)/sqrt(a*a+b*b+c*c);
  if (d1=d2) then
  begin
    writeln(d1)
  end else
  begin
    writeln('0');
  end;
  readln;
end.








